package com.ruoyi.factorydata.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 采购单信息对象 purchase_order_info
 *
 * @author ruoyi
 * @date 2025-07-17
 */
@Getter
@Setter
@TableName(resultMap = "com.ruoyi.factorydata.mapper.PurchaseOrderInfoMapper.PurchaseOrderInfoResult")
public class PurchaseOrderInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 采购单ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 采购单名编号
     */
    @Excel(name = "采购单名编号")
    private String purchaseOrderCode;

    /**
     * 仓库id
     */
    @Excel(name = "仓库id")
    private Long warehouseId;

    /**
     * 仓库编码
     */
    @Excel(name = "仓库编码")
    private String warehouseCode;

    /**
     * 供应商id
     */
    @Excel(name = "供应商id")
    private Long supplierId;

    /**
     * 供应商编码
     */
    @Excel(name = "供应商编码")
    private String supplierCode;

    /**
     * 经手人id
     */
    @Excel(name = "经手人id")
    private Long handlerId;

    /**
     * 业务时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "业务时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date bizTime;

    /**
     * 折扣率百分比
     */
    @Excel(name = "折扣率百分比")
    private BigDecimal discountRate;

    /**
     * 折扣金额单位元
     */
    @Excel(name = "折扣金额单位元")
    private BigDecimal discountAmount;

    /**
     * 附加金额单位元
     */
    @Excel(name = "附加金额单位元")
    private BigDecimal additionalAmount;
    /**
     * 实收金额
     */
    @Excel(name = "实收金额")
    private BigDecimal payAmount;

    /**
     * 结算方式
     */
    @Excel(name = "结算方式")
    private String settlementMethod;

    /**
     * 相关附件
     */
    @Excel(name = "相关附件")
    private String attachments;

    /**
     * 审核状态
     */
    @Excel(name = "审核状态")
    private Long status;

    /**
     * 审核内容
     */
    @Excel(name = "审核内容")
    private String authContext;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Version
    private Long version;

    @Excel(name = "入库仓库")
    @TableField(exist = false)
    private String warehouseName;


    @Excel(name = "供应商")
    @TableField(exist = false)
    private String supplierName;

    @Excel(name = "采购数量")
    @TableField(exist = false)
    private Integer totalNum;

    @Excel(name = "创建者")
    @TableField(exist = false)
    private String createByName;

    /**
     * 采购单详情
     */
    @TableField(exist = false)
    private List<PurchaseOrderDetail> purchaseOrderDetailList;

}